package com.spider.common.web.service;

import com.spider.common.bean.Category;
import com.spider.common.web.mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author marver
 * @Description 分类列表
 * @date 2018/12/17 15:31
 */
@Service
public class CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    /**
     * 查询分类
     * @param category
     * @return
     */
    public List<Category> queryCategoryList(Category category){
        return categoryMapper.select(category);
    }

    /**
     * 根据分类id查询 分类详情
     * @param id
     * @return
     */
    public Category queryCategoryById(Long id){
        return categoryMapper.selectByPrimaryKey(id);
    }
}


